Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Copy Methods

An application-defined attribute or element type may support any of four copying methods. The reason for defining four different methods is to let you customize the semantics of your Q3AttributeSet_Add and Q3AttributeSet_Get calls to allow for various meanings of the data parameter.

TQ3XElementCopyAddMethod

The TQ3XElementCopyAddMethod functionality is optional. If included, it supports adding a new attribute or element type to an attribute set. If it is not included, the default action is a memory copy of sizeOfElement bytes.

#define kQ3XMethodTypeElementCopyAdd Q3_METHOD_TYPE('e','c','p','a')
typedef TQ3Status (*TQ3XElementCopyAddMethod)(
                     const void    *fromAPIElement,
                     void          *toInternalElement);
fromAPIElement
API element to copy from.
toInternalElement
Internal element to copy to.

DESCRIPTION

The TQ3XElementCopyAddMethod method is called when adding a new attribute type to an attribute set, using Q3AttributeSet_Add . The application-defined object is passed whatever pointer was passed in the Q3AttributeSet_Add call as the fromAPIElement parameter, and in toInternalElement a pointer to an empty, uninitialized block of size sizeOfElement (obtained from the registration call).

TQ3XElementCopyReplaceMethod

The TQ3XElementCopyReplaceMethod functionality is optional. If included, it supports replacing an existing attribute or element type. If it is not included, the default action is a memory copy of sizeOfElement bytes.

#define kQ3XMethodTypeElementCopyReplace Q3_METHOD_TYPE('e','c','p','r')
typedef TQ3Status (*TQ3XElementCopyReplaceMethod)(
                     const void    *fromAPIElement,
                     void          *ontoInternalElement);
fromAPIElement
API element to copy from.
ontoInternalElement
Internal element to replace with copy.

DESCRIPTION

The TQ3XElementCopyReplaceMethod method is called when replacing an existing attribute type in an attribute set, using Q3AttributeSet_Add .The application-defined object is passed whatever pointer was passed in the Q3AttributeSet_Add call as the fromAPIElement parameter, and in ontoInternalElement a pointer to an existing block of size sizeOfElement (obtained from the registration call) that has previously been initialized with a CopyAdd call.

TQ3XElementCopyGetMethod

The TQ3XElementCopyGetMethod functionality is optional. If included, it supports fetching an attribute or element from an attribute set. If it is not included, the default action is a memory copy of sizeOfElement bytes.

#define kQ3XMethodTypeElementCopyGet Q3_METHOD_TYPE('e','c','p','g')
typedef TQ3Status (*TQ3XElementCopyGetMethod)(
                     const void    *fromInternalElement,
                     void          *toAPIElement);
fromInternalElement
Internal element to copy from.
toAPIElement
API element to copy to.

DESCRIPTION

The TQ3XElementCopyGetMethod method is called when obtaining an attribute from an attribute set by means of Q3AttributeSet_Get . The application-defined object is passed in fromInternalElement a pointer to an existing block of size sizeOfElement (determined by the registration call) that has been initialized with a CopyAdd call. It is passed in toAPIElement whatever pointer was passed in the Q3AttributeSet_Get call.

TQ3XElementCopyDuplicateMethod

The TQ3XElementCopyDuplicateMethod functionality is optional. If included, it supports internal duplication of attributes or elements. If it is not included, the default action is a memory copy of sizeOfElement bytes.

#define kQ3XMethodTypeElementCopyDuplicate Q3_METHOD_TYPE('e','c','p','d')
typedef TQ3Status (*TQ3XElementCopyDuplicateMethod)(
                     const void    *fromInternalElement,
                     void          *toInternalElement);
fromInternalElement
Internal element to copy from.
toInternalElement
Internal element to copy to.

DESCRIPTION

The TQ3XElementCopyDuplicateMethod method is called when Q3Object_Duplicate is called for an attribute set or element set. It copies data from a valid block of size sizeOfElement (determined by the registration call) to another block of size sizeOfElement . The block copied into must be invalid.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |